﻿/*
 *Author: Jeff Liu 
 *
 *Under MIT License
 *jebberwocky@gmail.com
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CtpGglTranslate.Interface
{
    /// <summary>
    /// Interface for CacheManger
    /// </summary>
    public interface ICacheManger
    {
        /// <summary>
        /// put value into cache with key
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="value">value</param>
        void put(String key, Object value);

        /// <summary>
        /// remove cache by key
        /// </summary>
        /// <param name="key">key</param>
        void invalidate(String key);

        /// <summary>
        /// remove all cache values
        /// </summary>
        void invalidateAll();

        /// <summary>
        /// put value into cache with key 
        /// </summary>
        /// <param name="key">key</param>
        /// <param name="value">value</param>
        /// <param name="duration">duration</param>
        void put(String key, Object value, TimeSpan duration);

        /// <summary>
        /// get value by key
        /// </summary>
        /// <param name="key">key</param>
        /// <returns>value</returns>
        Object get(String key);

        /// <summary>
        /// get all keys
        /// </summary>
        /// <returns>keys</returns>
        List<String> getKeys();
    }
}
